#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void sr_py(char* a,char* a1)
{
	int m = 0;
	scanf("%d", &m);

	while (*(a+m-1)!='\0')
	{
		*a1 = *(a+m-1);
		a1++;
		a++;
	}
	*a1 = '\0';
}
int main()
{
	char sign[] = "go to the mountains and sea";
	char a1[] = { 0 };
	puts(sign);
	sr_py(sign,a1);
	puts(a1);


	return 0;
}